package com.ihr360.payroll.service.alps.profile;


import com.google.common.collect.ImmutableList;
import com.ihr360.alps.PropertyDescriptor;
import com.ihr360.alps.PropertyType;
import com.ihr360.alps.ServiceDescriptor;
import com.ihr360.alps.api.ServiceProvider;
import com.ihr360.payroll.service.alps.profile.provider.EnrollDismissAdjustParamProvider;
import com.ihr360.payroll.service.alps.profile.provider.ProfileParamProvider;

import java.util.List;

/**
 * 入离职调整基数Alps定义
 */
public class EnrollDismissAdjustServiceProfile extends BaseServiceProfile{

    public static final EnrollDismissAdjustServiceProfile basementType = new EnrollDismissAdjustServiceProfile(1, "基数类型", "basementType", 0);
    public static final EnrollDismissAdjustServiceProfile calcBase = new EnrollDismissAdjustServiceProfile(2, "入离职调整基数", "calcBase", DEFAULT_VAL.FIXED_BASE);


    EnrollDismissAdjustServiceProfile(int index, String name, String code, double defaultValue) {
        super(index, name, code, defaultValue);
    }

    public static ServiceDescriptor serviceDescriptor() {
        List<PropertyDescriptor> propertyDescriptors = ImmutableList
                .of(
                        //标准工时
                        PropertyDescriptor.builder()
                                .id(basementType.getCode())
                                .name(basementType.getName())
                                .type(PropertyType.String)
                                .build(),
                        PropertyDescriptor.builder()
                                .id(calcBase.getCode())
                                .name(calcBase.getName())
                                .type(PropertyType.String)
                                .build(),
                        PropertyDescriptor.builder()
                                .id(monthWorkCount.getCode())
                                .name(monthWorkCount.getName())
                                .type(PropertyType.String)
                                .build(),
                        PropertyDescriptor.builder()
                                .id(dayWorkCount.getCode())
                                .name(dayWorkCount.getName())
                                .type(PropertyType.String)
                                .build()
                );
        return ServiceDescriptor.builder()
                .serviceId(ServiceProvider.SERVICE_ID.SALARY_ENTRY_DISMISS_ADJUST_RULE)
                .name("入离职调整")
                .path("/alps/" + ServiceProvider.SERVICE_ID.SALARY_ENTRY_DISMISS_ADJUST_RULE)
                .descriptors(propertyDescriptors)
                .build();
    }
    public static ProfileParamProvider profileParamProvider = new EnrollDismissAdjustParamProvider();
}